<?php
error_reporting(0);
require_once 'cfg.php';
$lm = isset($_GET['lm']) ? $_GET['lm']:'LM';
$id = isset($_GET['id']) ? $_GET['id']:1;

//mysql
$conn = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname,$conn);
mysql_set_charset('utf8');

$sql = "select * from news where id like {$id}";
$rs = mysql_query($sql);
$row = mysql_fetch_assoc($rs);
$title = $row['title'];
?>

<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>这是一个有SQL注入漏洞和XSS漏洞的页面</title>
  </head>
	<body>
  <h1>这是一个有SQL注入漏洞和XSS漏洞的页面</h1>
	
  <p>LM：<?php echo $lm;?></p>
  <p>TITLE：<?php echo $title;?></p>
  </body>
</html>
